#ifndef xpack_dumb_lambda_wrapper
#define xpack_dumb_lambda_wrapper
#pragma push_macro("xuser")
#undef  xuser
#define xuser mixc::dumb_lambda_wrapper::inc
#include"define/base_type.hpp"
#include"macro/xexport.hpp"
#include"meta/remove_ref.hpp"
#pragma pop_macro("xuser")

namespace mixc::dumb_lambda_wrapper{
    template<class lambda_t, template<typename> class ... rest_t>
    struct lambda_wrapper_core;

    template<class lambda_t>
    struct lambda_wrapper_core<lambda_t> : lambda_t{
        lambda_wrapper_core(lambda_t && self) : lambda_t((lambda_t &&)self){}
        lambda_wrapper_core(lambda_t & self) : lambda_t((lambda_t &)self){}
    };

    template<class lambda_t, template<typename> class first_t, template<typename> class ... rest_t>
    struct lambda_wrapper_core<lambda_t, first_t, rest_t...> : first_t<lambda_wrapper_core<lambda_t, rest_t...>>{
        using base_t = first_t<lambda_wrapper_core<lambda_t, rest_t...>>;
        using base_t::base_t;
    };

    template<template<typename> class first_t, template<typename> class ... rest_t>
    struct lambda_wrapper{
        template<class lambda_t>
        lambda_wrapper_core<inc::remove_ref<lambda_t>, first_t, rest_t...> operator * (lambda_t && lambda){
            return lambda_wrapper_core<inc::remove_ref<lambda_t>, first_t, rest_t...>((lambda_t &&)(lambda));
        }
    };
}

#endif

xexport(mixc::dumb_lambda_wrapper::lambda_wrapper)
